'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {

	async dataList(){
		const { ctx, app } = this;
		
		const { userTel } = ctx.query;
		
		// 参数验证
		const paramVerification = await ctx.parameter({ userTel })
		if(paramVerification !== ''){
		    return ctx.apiFail(paramVerification);
		}
		
		// 查询数据总记录数
		const resultsCount = await this.app.mysql.query('SELECT * FROM Yingji where userTel=' + userTel);
		
		return ctx.apiSuccess(resultsCount);
		
	}
}

module.exports = HomeController;
